package com.leanyuan.publi.dao;

import com.leanyuan.publi.domain.Order2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 相亲相爱一家人
 * @since 2021-05-25
 */
public interface Order2Mapper extends BaseMapper<Order2> {
    @Results(id="base", value={
            @Result(property = "payitems.pname",column = "pname"),
            @Result(property = "payitems.money",column = "money")
    })
    @Select("select o2.*,p.* from order2 o2 INNER JOIN orders o on o2.Order_id=o.Order_id " +
            "INNER JOIN Payitems p on o.P_id=p.P_id where o.house_id=#{id} and o2.Status='未缴费'")
List<Order2> findByOrderid(@Param("id") Integer id);
}
